Websydian v6.1 online documentationOnline documentation - Websydian v6.5

Problem - RepeatedEventDetection does not detect correctly

Severity Medium
Product Websydian
Websydian version 5.6 and previous
Resolved in v5.7
Plex version All
Platform All
Category Pattern
Problem If a PageGenerator function inherits from both RepeatedEventDetection and PageGeneratorWithErrorList, then when an event is activated for the third time, RepeatedEventDetection will not detect this and the event will be processed by the Websydian application.
Answer RepeatedEventDetection uses a page ID to identify on which page an event was activated.

When not using PageGeneratorWithErrorList the following happens:

  1. An user activates an event on a page.
  2. RepeatedEventDetection stores the event ID and the page ID.
  3. If the user activates the event again (using the browser back button to get back to the page) then RepeatedEventDetection detects that the event has been activated from that page.
  4. An error page is generated.

If using PageGeneratorWithErrorList then in step 4 the same page is reloaded with the error message. However, since this is a new page that is generated then it will have a new page ID and it is now possible to activate the event.

Workaround A workaround is to call a specific error page when a repeated event is detected.
  1. Create a new error page that inherits from WSYBASE/ErrorPage. E.g. call the new error page for EventDetectedErrorPage.
  2. In the abstract function RepeatedEventDetection.Abstract.EventHandler insert the call to the above error page in the edit point 'Prevous event detected':

    +For Defined Value Message: WSYSESS/Previous event detected
      Call WSYBASE/ServiceFunctions.ErrorHandler
    Call EventDetectedErrorPage
    Go Sub Terminate

On the template for EventDetectedErrorPage you can then insert a link/button that will bring the user to a main menu or another know starting point.